/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.chl.da.pagebeans;

import edu.chl.da.ejb.core.Destination;
import edu.chl.da.ejb.ctrl.IManageFlight;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.model.SelectItem;

/**
 *
 * @author Erik
 */
@ManagedBean(name="PackageBoxModel")
@RequestScoped
public class PackageBoxModel {

    @EJB
    private IManageFlight imf;

    /** Creates a new instance of PackageBoxModel */
    public PackageBoxModel() {
        
    }

    public List<SelectItem> getListFromDestinations() throws ParseException{
        List<SelectItem> listFromDestinations = new ArrayList<SelectItem>();
        for(Destination d : imf.getAllFromDestinationRouteFlights()){
            listFromDestinations.add(new SelectItem(d.getName(),d.getName()));
        }
        return listFromDestinations;
    }

}
